function getUUID(length = 6) {
  var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('')
  var uuid = []
  var i
  var radix = chars.length
  for (i = 0; i < length; i++) uuid[i] = chars[0 | (Math.random() * radix)]
  return uuid.join('')
}

export function emptyProcessXml() {
  return '<?xml version="1.0" encoding="UTF-8"?>\n' +
    '<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0fppxr8" targetNamespace="http://bpmn.io/schema/bpmn">\n' +
    '  <bpmn:process id="Process_' + getUUID() + '" isExecutable="true">\n' +
    '    <bpmn:startEvent id="StartEvent_1" name="begin&#10;">\n' +
    '      <bpmn:outgoing>SequenceFlow_0nrfbee</bpmn:outgoing>\n' +
    '    </bpmn:startEvent>\n' +
    '  </bpmn:process>\n' +
    '  <bpmndi:BPMNDiagram id="BPMNDiagram_1">\n' +
    '    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_' + getUUID() + '">\n' +
    '      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">\n' +
    '        <dc:Bounds x="173" y="102" width="36" height="36" />\n' +
    '        <bpmndi:BPMNLabel>\n' +
    '          <dc:Bounds x="178" y="145" width="27" height="27" />\n' +
    '        </bpmndi:BPMNLabel>\n' +
    '      </bpmndi:BPMNShape>\n' +
    '    </bpmndi:BPMNPlane>\n' +
    '  </bpmndi:BPMNDiagram>\n' +
    '</bpmn:definitions>\n'
}
